<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  

  
  <title>iOS开发</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta property="og:type" content="website">
<meta property="og:title" content="iOS开发">
<meta property="og:url" content="https:&#x2F;&#x2F;selinasun.gitee.io&#x2F;blog&#x2F;index.html">
<meta property="og:site_name" content="iOS开发">
<meta property="og:locale" content="en">
<meta name="twitter:card" content="summary">
  
    <link rel="alternate" href="/blog/atom.xml" title="iOS开发" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/blog/css/style.css">
</head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/blog/" id="logo">iOS开发</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/blog/">Home</a>
        
          <a class="main-nav-link" href="/blog/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/blog/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="https://selinaSun.gitee.io/blog"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main">
  
    <article id="post-NSDecimalNumber基本使用" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/blog/2019/12/03/NSDecimalNumber%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8/" class="article-date">
  <time datetime="2019-12-03T06:04:21.000Z" itemprop="datePublished">2019-12-03</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/blog/2019/12/03/NSDecimalNumber%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8/">NSDecimalNumber基本使用</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="NSDecimalNumber继承自NSNumber，用于对浮点型数据的精度计算"><a href="#NSDecimalNumber继承自NSNumber，用于对浮点型数据的精度计算" class="headerlink" title="NSDecimalNumber继承自NSNumber，用于对浮点型数据的精度计算"></a>NSDecimalNumber继承自NSNumber，用于对浮点型数据的精度计算</h2><h3 id="数值处理"><a href="#数值处理" class="headerlink" title="数值处理"></a>数值处理</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">/*</span><br><span class="line"> NSRoundPlain:四舍五入  NSRoundDown:向下取正   NSRoundUp:向上取正     NSRoundBankers:(特殊的四舍五入，碰到保留位数后一位的数字为5时，根据前一位的奇偶性决定。为偶时向下取正，为奇数时向上取正。如：1.25保留1为小数。5之前是2偶数向下取正1.2；1.35保留1位小数时。5之前为3奇数，向上取正1.4）</span><br><span class="line"> scale:精确到几位小数</span><br><span class="line"> raiseOnExactness:发生精确错误时是否抛出异常，一般为NO</span><br><span class="line"> raiseOnOverflow:发生溢出错误时是否抛出异常，一般为NO</span><br><span class="line"> raiseOnUnderflow:发生不足错误时是否抛出异常，一般为NO</span><br><span class="line"> raiseOnDivideByZero:被0除时是否抛出异常，一般为YES</span><br><span class="line"> */</span><br><span class="line">NSDecimalNumber * inputNumber = [[NSDecimalNumber alloc]initWithString:@<span class="string">"340.0700001"</span>];</span><br><span class="line">NSDecimalNumberHandler *roundUp = [NSDecimalNumberHandler</span><br><span class="line">                                   decimalNumberHandlerWithRoundingMode:NSRoundDown</span><br><span class="line">                                   scale:2</span><br><span class="line">                                   raiseOnExactness:NO</span><br><span class="line">                                   raiseOnOverflow:NO</span><br><span class="line">                                   raiseOnUnderflow:NO</span><br><span class="line">                                   raiseOnDivideByZero:YES];</span><br><span class="line">NSDecimalNumber * number = [inputNumber decimalNumberByRoundingAccordingToBehavior: roundUp];</span><br><span class="line">NSLog(@<span class="string">"%@"</span>,number);</span><br></pre></td></tr></table></figure>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://selinasun.gitee.io/blog/2019/12/03/NSDecimalNumber%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8/" data-id="ck7vjbbka000067286dco2ehl" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
</article>


  
    <article id="post-git-SSH多证书环境配置" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/blog/2019/12/03/git-SSH%E5%A4%9A%E8%AF%81%E4%B9%A6%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/" class="article-date">
  <time datetime="2019-12-03T06:01:25.000Z" itemprop="datePublished">2019-12-03</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/blog/2019/12/03/git-SSH%E5%A4%9A%E8%AF%81%E4%B9%A6%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/">git SSH多证书环境配置</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="SSH添加多个证书"><a href="#SSH添加多个证书" class="headerlink" title="SSH添加多个证书"></a>SSH添加多个证书</h2><h3 id="ssh-add-k-Users-my-ssh-id-rsa2"><a href="#ssh-add-k-Users-my-ssh-id-rsa2" class="headerlink" title="ssh-add -k /Users/my/.ssh/id_rsa2"></a>ssh-add -k /Users/my/.ssh/id_rsa2</h3>
      
    </div>
    <footer class="article-footer">
      <a data-url="https://selinasun.gitee.io/blog/2019/12/03/git-SSH%E5%A4%9A%E8%AF%81%E4%B9%A6%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/" data-id="ck7vjbbki000367286j6wbikt" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
</article>


  
    <article id="post-cocoaPods忽略更新安装" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/blog/2019/12/02/cocoaPods%E5%BF%BD%E7%95%A5%E6%9B%B4%E6%96%B0%E5%AE%89%E8%A3%85/" class="article-date">
  <time datetime="2019-12-02T10:22:45.000Z" itemprop="datePublished">2019-12-02</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/blog/2019/12/02/cocoaPods%E5%BF%BD%E7%95%A5%E6%9B%B4%E6%96%B0%E5%AE%89%E8%A3%85/">cocoaPods忽略更新安装</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="cocoaPods安装时间过长时可用忽略更新"><a href="#cocoaPods安装时间过长时可用忽略更新" class="headerlink" title="cocoaPods安装时间过长时可用忽略更新"></a>cocoaPods安装时间过长时可用忽略更新</h2><h3 id="pod-install-–verbose-–no-repo-update"><a href="#pod-install-–verbose-–no-repo-update" class="headerlink" title="pod install –verbose –no-repo-update"></a>pod install –verbose –no-repo-update</h3><h3 id="pod-update-–verbose-–no-repo-update"><a href="#pod-update-–verbose-–no-repo-update" class="headerlink" title="pod update –verbose –no-repo-update"></a>pod update –verbose –no-repo-update</h3>
      
    </div>
    <footer class="article-footer">
      <a data-url="https://selinasun.gitee.io/blog/2019/12/02/cocoaPods%E5%BF%BD%E7%95%A5%E6%9B%B4%E6%96%B0%E5%AE%89%E8%A3%85/" data-id="ck7vjbbkh000267286m7nag7y" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
</article>


  
    <article id="post-UIActivityViewController的使用说明" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/blog/2019/11/29/UIActivityViewController%E7%9A%84%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E/" class="article-date">
  <time datetime="2019-11-29T10:19:42.000Z" itemprop="datePublished">2019-11-29</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/blog/2019/11/29/UIActivityViewController%E7%9A%84%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E/">UIActivityViewController的使用说明</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="UIActivity-ActivityType类型对应"><a href="#UIActivity-ActivityType类型对应" class="headerlink" title="UIActivity.ActivityType类型对应"></a>UIActivity.ActivityType类型对应</h2><h3 id="addToReadingList-加入阅读列表"><a href="#addToReadingList-加入阅读列表" class="headerlink" title="addToReadingList //加入阅读列表"></a>addToReadingList //加入阅读列表</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">static <span class="built_in">let</span> addToReadingList: UIActivity.ActivityType</span><br></pre></td></tr></table></figure>
<h3 id="saveToCameraRoll-存储图片"><a href="#saveToCameraRoll-存储图片" class="headerlink" title="saveToCameraRoll //存储图片"></a>saveToCameraRoll //存储图片</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">static <span class="built_in">let</span> addToReadingList: UIActivity.ActivityType</span><br></pre></td></tr></table></figure>
<h3 id="assignToContact-指定给联系人"><a href="#assignToContact-指定给联系人" class="headerlink" title="assignToContact //指定给联系人"></a>assignToContact //指定给联系人</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">static <span class="built_in">let</span> assignToContact: UIActivity.ActivityType</span><br></pre></td></tr></table></figure>
<h3 id="airDrop-空投"><a href="#airDrop-空投" class="headerlink" title="airDrop //空投"></a>airDrop //空投</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">static <span class="built_in">let</span> airDrop: UIActivity.ActivityType</span><br></pre></td></tr></table></figure>
<h3 id="copyToPasteboard-复制到剪贴板"><a href="#copyToPasteboard-复制到剪贴板" class="headerlink" title="copyToPasteboard //复制到剪贴板"></a>copyToPasteboard //复制到剪贴板</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">static <span class="built_in">let</span> copyToPasteboard: UIActivity.ActivityType</span><br></pre></td></tr></table></figure>
<h3 id="mail-邮件"><a href="#mail-邮件" class="headerlink" title="mail //邮件"></a>mail //邮件</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">static <span class="built_in">let</span> mail: UIActivity.ActivityType</span><br></pre></td></tr></table></figure>
<h3 id="message-短信"><a href="#message-短信" class="headerlink" title="message //短信"></a>message //短信</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">static <span class="built_in">let</span> message: UIActivity.ActivityType</span><br></pre></td></tr></table></figure>
<h3 id="openInIBooks-从IBooks打开"><a href="#openInIBooks-从IBooks打开" class="headerlink" title="openInIBooks //从IBooks打开"></a>openInIBooks //从IBooks打开</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">static <span class="built_in">let</span> openInIBooks: UIActivity.ActivityType</span><br></pre></td></tr></table></figure>
<h3 id="postToFacebook-发送给Facebook"><a href="#postToFacebook-发送给Facebook" class="headerlink" title="postToFacebook //发送给Facebook"></a>postToFacebook //发送给Facebook</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">static <span class="built_in">let</span> postToFacebook: UIActivity.ActivityType</span><br></pre></td></tr></table></figure>
<h3 id="postToFlickr-发送给Flickr"><a href="#postToFlickr-发送给Flickr" class="headerlink" title="postToFlickr //发送给Flickr"></a>postToFlickr //发送给Flickr</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">static <span class="built_in">let</span> postToFlickr: UIActivity.ActivityType</span><br></pre></td></tr></table></figure>
<h3 id="postToTencentWeibo-发送给腾讯微博"><a href="#postToTencentWeibo-发送给腾讯微博" class="headerlink" title="postToTencentWeibo //发送给腾讯微博"></a>postToTencentWeibo //发送给腾讯微博</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">static <span class="built_in">let</span> postToTencentWeibo: UIActivity.ActivityType</span><br></pre></td></tr></table></figure>
<h3 id="postToTwitter-发送给Twitter"><a href="#postToTwitter-发送给Twitter" class="headerlink" title="postToTwitter //发送给Twitter"></a>postToTwitter //发送给Twitter</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">static <span class="built_in">let</span> postToTwitter: UIActivity.ActivityType</span><br></pre></td></tr></table></figure>
<h3 id="postToVimeo-发送给Vimeo"><a href="#postToVimeo-发送给Vimeo" class="headerlink" title="postToVimeo //发送给Vimeo"></a>postToVimeo //发送给Vimeo</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">static <span class="built_in">let</span> postToVimeo: UIActivity.ActivityType</span><br></pre></td></tr></table></figure>
<h3 id="postToWeibo-发送给新浪微博"><a href="#postToWeibo-发送给新浪微博" class="headerlink" title="postToWeibo //发送给新浪微博"></a>postToWeibo //发送给新浪微博</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">static <span class="built_in">let</span> postToWeibo: UIActivity.ActivityType</span><br></pre></td></tr></table></figure>
<h3 id="print-打印"><a href="#print-打印" class="headerlink" title="print //打印"></a>print //打印</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">static <span class="built_in">let</span> <span class="built_in">print</span>: UIActivity.ActivityType</span><br></pre></td></tr></table></figure>
<h3 id="markupAsPDF-导出PDF"><a href="#markupAsPDF-导出PDF" class="headerlink" title="markupAsPDF //导出PDF"></a>markupAsPDF //导出PDF</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">static <span class="built_in">let</span> markupAsPDF: UIActivity.ActivityType</span><br></pre></td></tr></table></figure>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://selinasun.gitee.io/blog/2019/11/29/UIActivityViewController%E7%9A%84%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E/" data-id="ck7vjbbkf00016728brjk9pl7" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
</article>


  


</section>
        
          <aside id="sidebar">
  
    

  
    

  
    
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2019/12/">December 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2019/11/">November 2019</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/blog/2019/12/03/NSDecimalNumber%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8/">NSDecimalNumber基本使用</a>
          </li>
        
          <li>
            <a href="/blog/2019/12/03/git-SSH%E5%A4%9A%E8%AF%81%E4%B9%A6%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/">git SSH多证书环境配置</a>
          </li>
        
          <li>
            <a href="/blog/2019/12/02/cocoaPods%E5%BF%BD%E7%95%A5%E6%9B%B4%E6%96%B0%E5%AE%89%E8%A3%85/">cocoaPods忽略更新安装</a>
          </li>
        
          <li>
            <a href="/blog/2019/11/29/UIActivityViewController%E7%9A%84%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E/">UIActivityViewController的使用说明</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2020 selinaSun<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/blog/" class="mobile-nav-link">Home</a>
  
    <a href="/blog/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/blog/fancybox/jquery.fancybox.css">
  <script src="/blog/fancybox/jquery.fancybox.pack.js"></script>


<script src="/blog/js/script.js"></script>



  </div>
</body>
</html>